<?php
$srcPath = '../src';

$frameworkPath = $srcPath . '/framework';

require_once $frameworkPath . '/Framework.php';

$framework = new Framework;

$framework->boot();

$mysqliConfig = array(
'schema' => 'seraph_test',
'host' => 'localhost',
'user' => 'seraph_test',
'pass' => 'password'
);

$mysqli = new MySQLiDBConnection($mysqliConfig['host'], $mysqliConfig['user'], $mysqliConfig['pass'], $mysqliConfig['schema']);

Model::addDatabase('test', $mysqli);



/*
$testUser = new user();

$testUser->name = 'Tom';
$testUser->email = 'tom@takeontom.com';

$testUser->insert();

$newID = $testUser->id;

$testUser = null;

$userDAO = user::getDAO();

$testUser = $userDAO->get(new user(), array('id' => $newID));

$testUser->name = 'Little Tom';
$testUser->update();

$testUser = null;


$u2 = $userDAO->get(new user(), array('id' => $newID));
*/
/*
if ($u2)	{
	$u2->delete();
}
*/


/*
$group = new user_group;

$group->user_id = 3;
$group->group_id = 1;
$group->insert();
*/


$ug = Model::get('user_group', array('user_id' => 3, 'group_id' => 1));

//print_r ($ug);

$user = $ug->get_user();

//echo $user->id;

$userGroups = $user->getAll_user_group();

foreach($userGroups as $aUG)	{
	echo $aUG->get_group()->name;
}
?>